package com.woniuxy.sale.exception.handler;

import com.woniuxy.response.ResponseResult;
import com.woniuxy.sale.exception.SaleMoneyAddException;
import com.woniuxy.sale.exception.SaleOrderAddException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class SaleOrderExceptionHandler {

    @ExceptionHandler({SaleOrderAddException.class})
    public ResponseResult<Object> handler(Exception e){
        return new ResponseResult<>(ResponseResult.AddSaleOrder_ERROR,e.getMessage(),e);
    }
}